/*
 * @(#) ForeignMatter.java 2013-8-9 下午4:14:56
 *
 * Copyright 2013 Rockwell Automation, Inc. All rights reserved.
 * Rockwell Automation PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */package com.osi.mes.pm.object;

import com.datasweep.compatibility.client.ATRow;
import com.datasweep.compatibility.client.Response;
import com.datasweep.compatibility.client.Route;
import com.datasweep.compatibility.client.Step;
import com.datasweep.compatibility.ui.Time;
import com.osi.mes.base.object.AtRowData;
import com.osi.mes.constants.IATConstants;
import com.osi.mes.constants.IDateFormatConstants;
import com.rockwell.ftpc.framework.common.DateTimeUtils;

/**
 * 异物信息
 * @author Nemo, 2013-8-9 下午4:15:01
 */
public class ForeignMatter extends AtRowData
{
	public ForeignMatter(ATRow atRow)
	{
		super(atRow);
	}
	
	public String getProdBatch()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_PROD_BATCH));
	}
	
	public void setProdBatch(String batchName)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_PROD_BATCH, batchName);
	}
	
	public String getFormatRecTime()
	{
		Time recTime = getRecTime();
		return DateTimeUtils.formatDate(recTime, IDateFormatConstants.DATE_TIME_FORMAT_DAY);
	}
	
	public Time getRecTime()
	{
		return  toTime(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_REC_TIME));
	}
	
	public void setRecTime(Time time)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_REC_TIME, time);
	}
	
	public String getStepName()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_ROUTE_STEP_NAME));
	}
	
	public void setStep(Step step)
	{
		String stepName = step.getOperation().getDescription();
//			step.getName();
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_ROUTE_STEP_NAME, stepName);
	}
	
	public String getRouteName()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_ROUTE_NAME));
	}
	
	public void setRoute(Route route)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_ROUTE_NAME, route.getName());
	}
	
	public String getForeignMatterType()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_FOREIGN_MATTER_TYPE));
	}
	
	public void setForeignMatterType(String foreignMatterType)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_FOREIGN_MATTER_TYPE, foreignMatterType);
	}
	
	public String getForeignMatterBigType()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_FOREIGN_MATTER_BIG_TYPE));
	}
	
	public void setForeignMatterBigType(String foreignMatterBigType)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_FOREIGN_MATTER_BIG_TYPE, foreignMatterBigType);
	}
	
	public String getRecPeople()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_REC_PEOPLE));
	}
	
	public void setRecPeople(String recPeople)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_REC_PEOPLE,recPeople);
	}
	
	public String getHandleMethod()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_HANDLE_MATHOD));
	}
	
	public void setHandleMethod(String handleMethod)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_HANDLE_MATHOD,handleMethod);
	}
	
	public String getMark()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_MARK));
	}
	
	public void setMark(String mark)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_MARK,mark);
	}

	public String getOrderNumber()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_ORDER_NUMBER));
	}
	
	public void setOrderNumber(String orderName)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_ORDER_NUMBER,orderName);
	}
	
	public String getMaterialName()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_MATERIAL_NAME));
	}
	
	public void setMaterialName(String mark)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_MARK,mark);
	}
	
	public String getSupplier()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_SUPPLIER));
	}
	
	public void setSupplier(String supplier)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_SUPPLIER, supplier);
	}
	
	public String getSupplierNo()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_SUPPLIER_NO));
	}
	
	public void setSupplierNo(String supplier)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_SUPPLIER_NO, supplier);
	}
	
	public Integer getMatterQty()
	{
		return toInteger(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_MATTER_QUANTITY));
	}
	
	public void setMatterQty(Integer quantity)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_MATTER_QUANTITY, quantity);
	}
	
	public String getMatterUom()
	{
		return toString(getAtRow().getValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_MATTER_UOM));
	}
	
	public void setMatterUom(String uom)
	{
		getAtRow().setValue(IATConstants.AT_COLUMN_QM_FOREIGN_MATTER_MATTER_UOM, uom);
	}
	
	public Response save()
	{
		return getAtRow().save(null, null, null);
	}
}
